package com.study.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;

/**
 * @description 登录用户
 * @author hw
 * @date 2021/12/23 20:48:03
 */
@Data
@Builder
@AllArgsConstructor
@Table(name = "sys_user_${userName}")
public class SysUser implements Serializable {
    /**
     * 主键ID
     */
    @Id
    private String chrId;

    /**
     * 登录名
     */
    private String userName;

    /**
     * 密码
     */
    private String password;

    /**
     * 旧密码
     */
    @Transient
    private String oldPassWord;

    /**
     * @description 共有字段
     * @author hw
     * @date 2021/12/20 13:25:55
     */
    @Transient
    public String like;

    /**
     * @description 测试方法
     * @author hw
     * @date 2021/12/20 20:47:39
     */
    public void run(String run){
        System.out.println("just run " + run + " ...");
    }

    public SysUser() {
    }

    public SysUser(String chrId, String userName, String password, String oldPassWord) {
        this.chrId = chrId;
        this.userName = userName;
        this.password = password;
        this.oldPassWord = oldPassWord;
    }
}
